from flask import Flask,render_template,redirect,url_for

# 实例化对象
app =Flask(__name__)
app.debug=True


#方式一(一般常用)
@app.route('/index',methods=['GET','POST'],endpoint='n1')
# @app.route('/index')
def index():
    v1=url_for('n1')
    v2=url_for('login')
    v3=url_for('logout')
    print(v1,v2,v3)
    return "index"

@app.route('/login',methods=['GET','POST'])
# @app.route('/index')
def login():
    return "login"

@app.route('/logout',methods=['GET','POST'])
# @app.route('/index')
def logout():
    return "logout"

# 方式2
# def order():
#     return "123"
# app.add_url_rule('/order',view_func=order)


if __name__=='__main__':
    app.run()

